package com.huilian.iotbox.client.service.impl;

import com.huilian.iotbox.client.dao.DisplayRackItemDao;
import com.huilian.iotbox.client.service.DeviceService;
import com.huilian.iotbox.client.service.DisplayRackItemService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.dto.DisplayRackItemDto;
import com.huilian.iotbox.data.dto.MemberDto;
import com.huilian.iotbox.data.po.DisplayRackItem;
import com.huilian.iotbox.data.vo.DeviceVo;
import com.huilian.iotbox.data.vo.DisplayRackItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

@Service
public class DisplayRackItemServiceImpl implements DisplayRackItemService {

    @Autowired
    private DeviceService deviceService;
    @Autowired
    private DisplayRackItemDao displayRackItemDao;

    @Override
    public DisplayRackItemVo findDisplayRackItem(DisplayRackItemDto displayRackItemDto) {
        return displayRackItemDao.findDisplayRackItem(displayRackItemDto);
    }

    @Override
    public DisplayRackItemVo findDisplayRackItemById(DisplayRackItemDto displayRackItemDto) {
        return displayRackItemDao.findDisplayRackItemById(displayRackItemDto);
    }

    @Override
    public DisplayRackItemVo findDisplayRackItemByDeviceId(DisplayRackItemDto displayRackItemDto) {
        return displayRackItemDao.findDisplayRackItemByDeviceIdV2(displayRackItemDto);
    }

    @Override
    public List<DisplayRackItemVo> findDisplayRackItemByCommodityId(DisplayRackItemDto displayRackItemDto) {
        return displayRackItemDao.findDisplayRackItemByCommodityId(displayRackItemDto);
    }

    @Override
    public int updateStockById(DisplayRackItemDto displayRackItemDto) {
        return displayRackItemDao.updateStockById(displayRackItemDto);
    }

    @Override
    public DisplayRackItemVo findDisplayRackItemByDeviceIdAndCommodityId(DisplayRackItemDto displayRackItemDto) {
        return displayRackItemDao.findDisplayRackItemByDeviceIdAndCommodityId(displayRackItemDto);
    }
}
